<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>设置 - 会员中心 -  <?php echo C('UU_SITE_NAME');?></title>
<link href="/<?php echo C('UU_TPL_DIR');?>/public/css/user.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/<?php echo C('UU_TPL_DIR');?>/public/css/common.css" rel="stylesheet" type="text/css">
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.min.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.dialog.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/common.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.disappear.tooltip.js"></script>
<!--[if lt IE 9]>
  <script type="text/javascript" src="/<?php echo C('UU_TPL_DIR');?>/public/js/PIE.js"></script>
  <script type="text/javascript">
    (function($){
        $.pie = function(name, v){
            // 如果没有加载 PIE 则直接终止
            if (! PIE) return false;
            // 是否 jQuery 对象或者选择器名称
            var obj = typeof name == 'object' ? name : $(name);
            // 指定运行插件的 IE 浏览器版本
            var version = 9;
            // 未指定则默认使用 ie10 以下全兼容模式
            if (typeof v != 'number' && v < 9) {
                version = v;
            }
            // 可对指定的多个 jQuery 对象进行样式兼容
            if ($.browser.msie && obj.size() > 0) {
                if ($.browser.version*1 <= version*1) {
                    obj.each(function(){
                        PIE.attach(this);
                    });
                }
            }
        }
    })(jQuery);
    if ($.browser.msie) {
      $.pie('.pie_about');
    };
  </script>
<![endif]-->
<script type="text/javascript">
var ajaxURL="<?php echo RU('ajax/view');?>";
</script>
</head>
<style>
    .sotit {
        width: 120px;
        float: left;
        font-size: 20px;
        padding-top: 35px;
        text-align: right;
        padding-right: 25px;
    }
    .search form{
        width: 430px;
        float: left;
        height: 42px;
        border: 3px #6DBD60 solid;
        background-color: #FFF;
        margin-top: 25px;
        position: relative;
    }
    .so-input{
        border: 0px;
        background-color: #FFFFFF;
        height: 40px;
        width: 380px;
        padding-left: 15px;
    }


    .search .sobtn {
        position: absolute;
        right: -3px;
        top: -3px;
        width: 80px;
        background-color: #6DBD60;
        border: 0px;
        color: #FFFFFF;
        height: 48px;
        font-size: 16px;
        cursor: pointer;
    }
    </style>
<body>

<div class="pagetop">
		<div class="main">
          <div class="welcome link_orange" id="J_welcome">欢迎登录 <?php echo C('UU_SITE_NAME');?>！请 <span><a href="Javascript: void(0)" class="J_user_login">登录</a></span>或<span><a href="Javascript: void(0)" class="J_user_reg">注册</a></span></div>
          <div class="menu link_gray6"><a href="<?php echo C('UU_SITE_DOMAIN');?>/" class="home">网站首页</a>
		  
		  <!-- <a href="#" class="ranking">排行榜</a> <a href="#" class="category">问题分类</a> <a href="#" class="mall">积分商城</a> -->
		   
		   </div>
        	<div class="clear"></div>
        </div>
</div>

<div class="header">
  <div class="logo" style="width: 220px"><a href="/"><img src="http://www.zgxmall.com/data/upload/mall/common/05999185122820637.png"  alt="<?php echo C('UU_SITE_NAME');?>" border="0"/></a></div>
    <!--<div class="sotit">商品</div>-->
    <!--<div class="search" >-->
        <!--<form action="<?php echo RU('article/lists');?>" method="get" id="J_so_from">-->
            <!--<div class="sobox">-->
                <!--<div class="inputbox">-->
                    <!--<input type="text" class="so-input"  name="key"  value="<?php echo ($_REQUEST['key']); ?>" placeholder="请输入关键词">-->
                    <!--<input name="" type="submit" value="搜索" class="sobtn">-->
                <!--</div>-->
            <!--</div>-->
        <!--</form>-->
    <!--</div>-->
    <div class="so"></div>
  <div class="clear"></div>

</div>

<div class="pagenav">
  <div class="navmain link_white">
  <?php $tag_nav_class = new \Common\Taglib\nav();$nav = $tag_nav_class->run(array('listname'=>'nav','cache'=>'0',)); ?>
			<?php if(is_array($nav)): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i;?><div class="li  <?php if($page_as == $nav['pagealias']): ?>select<?php endif; ?>"><a href="<?php echo ($nav["url"]); ?>" target="<?php echo ($nav["target"]); ?>"><?php echo ($nav["title"]); ?></a></div><?php endforeach; endif; else: echo "" ;endif; ?>
    <div class="clear"></div>
  </div>
</div>

<div class="usermain">
  <div class="mleft">
<div class="mu">
	<?php if($user["isadmin"] == '1'): ?><a class="adminbtn" href="<?php echo RU('admin/index');?>" title="后台登录"></a><?php endif; ?>
  <div class="pic"><a href="<?php echo RU('user/set_avatar');?>"><img src="<?php echo ($user["avatar"]); ?>" border="0"></a></div>
			  
			  <a class="uname" href="<?php echo RU('user/set_basic');?>"><?php echo ($user["username"]); ?></a>
			  
			  <div class="exp link_gray3">
					<span class="userLV">LV<?php echo ($user["exp_lv"]); ?></span>经验值：<a href="<?php echo RU('user/set_exp');?>"><?php echo ($user["exp"]); ?>/<?php echo ($lv["exp_max"]); ?></a>
	  </div>
	 
			<div class="progress">
			  <div class="nblock" style="width:<?php echo ($user["percentage"]); ?>"></div>
			</div>
  
	        <div class="gold link_gray3"><?php echo C('UU_GOLD_BYNAME');?>：<a href="<?php echo RU('user/set_gold');?>"><?php echo ($user["gold"]); ?></a></div>			
				
			<div class="lnav">
			<a href="<?php echo RU('user/index');?>" class="mli t0 <?php if($nav_select == 'index'): ?>select<?php endif; ?>">会员中心</a>
			<a href="<?php echo RU('user/question');?>" class="mli t1 <?php if($nav_select == 'question'): ?>select<?php endif; ?>">我的问答</a>
			<a href="<?php echo RU('user/article');?>" class="mli t2 <?php if($nav_select == 'article'): ?>select<?php endif; ?>">我的分享</a>
			<a href="<?php echo RU('user/task');?>" class="mli t3 <?php if($nav_select == 'task'): ?>select<?php endif; ?>">我的任务</a>
			<a href="<?php echo RU('user/msg');?>" class="mli t4 <?php if($nav_select == 'msg'): ?>select<?php endif; ?>">我的消息</a>
			<a href="<?php echo RU('user/set_basic');?>" class="mli t5 <?php if($nav_select == 'set'): ?>select<?php endif; ?>">账号设置</a>
			</div>
			<a class="userlogout J_user_logout" href="Javascript:void(0)">退出登录</a>
		   
</div>
  </div>
  
  <div class="mright">
  
    
	
    <div class="mbox">
	  	<div class="utopt">
			  <div class="tit">账号设置</div>
			<a class="snav <?php if(ACTION_NAME == 'set_basic'): ?>select<?php endif; ?>" href="<?php echo RU('user/set_basic');?>">基本</a>
<a class="snav <?php if(ACTION_NAME == 'set_avatar'): ?>select<?php endif; ?>" href="<?php echo RU('user/set_avatar');?>">头像</a>
<a class="snav <?php if(ACTION_NAME == 'set_pwd'): ?>select<?php endif; ?>" href="<?php echo RU('user/set_pwd');?>">密码</a>
<a class="snav <?php if(ACTION_NAME == 'set_gold'): ?>select<?php endif; ?>" href="<?php echo RU('user/set_gold');?>"><?php echo C('UU_GOLD_BYNAME');?></a>
<a class="snav <?php if(ACTION_NAME == 'set_exp'): ?>select<?php endif; ?>" href="<?php echo RU('user/set_exp');?>">经验</a>
<a href="<?php echo RU('user/set_lv');?>" class="snav <?php if(ACTION_NAME == 'set_lv'): ?>select<?php endif; ?>" >等级</a>
<a href="<?php echo RU('user/set_loginlog');?>"  class="snav <?php if(ACTION_NAME == 'set_loginlog'): ?>select<?php endif; ?>" >登录记录</a>



			<div class="clear"></div>
	  </div>
	  
	  
        <div class="user_form_tit">
		<h2>基本</h2>
		</div>
		
		
        <div class="set_main">
		 <div class="fl">用户名:</div>
		<div class="fr">
		  <div class="txt substring" id="J_uname"><?php echo ($user["username"]); ?></div>
		  
		  <div class="editbtn J_user_edit_username">点击修改</div>
		  <div class="clear"></div>
		</div>
		<div class="fl">手机号:</div>
		<div class="fr">
		  <div class="txt" id="J_umobile"><?php echo ((isset($user["mobile_txt"]) && ($user["mobile_txt"] !== ""))?($user["mobile_txt"]):"未填写手机号"); ?></div>
		   <div class="editbtn J_user_edit_mobile">点击修改</div>
		   <div class="clear"></div>
		</div>
		<div class="fl">我的擅长:</div>
		<div class="fr">
		  <div class="sp J_user_edit_sp"><?php echo ((isset($user["specialty"]) && ($user["specialty"] !== ""))?($user["specialty"]):"这家伙很懒，什么也没有留下！"); ?></div>
		   <div class="clear"></div>
		</div>
		<div class="clear"></div>
		</div>
		
		
		 <div class="user_form_tit">
		<h2>账号绑定</h2>
		</div>
		
		 <div class="set_binding">
		 
		 
		 
		
		
		 <?php if(is_array($oauth_list)): $i = 0; $__LIST__ = $oauth_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$oauth): $mod = ($i % 2 );++$i;?><div class="list ">

			<?php if(($oauth["is_bind"]) == "1"): ?><a class="uu_api_login_btn <?php echo ($key); ?>" href="<?php echo U('callback/index',array('mod'=>$key,'type'=>'login'));?>"></a>
				   <div class="apiname"><?php echo ($oauth["name"]); ?>已绑定 </div>
				    <a class="editbtn" href="<?php echo U('callback/index',array('mod'=>$key,'type'=>'login'));?>">点击解绑</a>
		   <?php else: ?>
					<a class="uu_api_login_btn <?php echo ($key); ?>" href="<?php echo U('callback/index',array('mod'=>$key,'type'=>'login'));?>"></a>
					<div class="apiname"><?php echo ($oauth["name"]); ?>未绑定 </div>
				   <a class="editbtn" href="<?php echo U('callback/index',array('mod'=>$key,'type'=>'login'));?>">点击绑定</a><?php endif; ?>
		   
		   <div class="clear"></div>
	      <?php if(($oauth["is_bind"]) == "1"): ?><div class="sign"></div><?php endif; ?>
		   </div><?php endforeach; endif; else: echo "" ;endif; ?>
		   
		   
		   
		   
      </div>
	 
					
		
		
    </div>
	
	 
	
	
  </div>
   <div class="clear"></div>
</div>
<div class="footernav link_gray6">
<a href="<?php echo C('UU_SITE_DOMAIN');?>/">首页</a>
<?php $tag_intro_class = new \Common\Taglib\intro();$li = $tag_intro_class->run(array('listname'=>'li','cache'=>'0',)); ?>
<?php if(is_array($li["list"])): $i = 0; $__LIST__ = $li["list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$li): $mod = ($i % 2 );++$i;?><span>|</span><a href="<?php echo ($li["url"]); ?>" target="_blank"><?php echo ($li["title"]); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
</div>  
<div class="footertxt link_gray3">
<a href="http://www.miibeian.gov.cn/" target="_blank"><?php echo C('UU_ICP');?></a>
Powered By <a href="http://www.zgxmall.com" target="_blank"><span class="by">中港星企业服务论坛</span><span class="version"><?php echo C('UU_VERSION');?></span></a>
<?php echo C('UU_COPYRIGHT');?>
<br />
联系地址：深圳市罗湖区人民南路国贸大厦17、19楼&nbsp;&nbsp;&nbsp;&nbsp;联系电话：0755-82211688
 
<div class="statistics"><?php echo C('UU_STATISTICS');?></div>
</div>


<script type="text/javascript">
$(document).ready(function()
{

$('.J_user_edit_username').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		 $.getJSON(ajaxURL, { act: "ajax_edit_username"}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var editDialog = $(this).dialog({
								title: "修改用户名",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
								yes: function() {
									
									username=$('#ajax_edit_username_input').val()
										$.getJSON(ajaxURL, { act: "ajax_edit_username",username:username,edit:'1'}, function(json){
										if (json.status==0){
											disapperTooltip("remind", json.content);
										}else if (json.status==1){
											$('#J_uname').text(json.username);
 											disapperTooltip("success",json.content);
										}else{
											disapperTooltip("remind","修改失败，未知错误");
										}
								});
									
 	
									
							}
						});
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});
	$('.J_user_edit_mobile').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		 $.getJSON(ajaxURL, { act: "ajax_edit_mobile"}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var MDialog = $(this).dialog({
								title: "修改手机号",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
						 		yes: function() {
									
									mobile=$("input[name='mobile']").val();
									code=$("input[name='code']").val();
								$.getJSON(ajaxURL, { act: "ajax_edit_mobile",mobile:mobile,code:code,edit:"1"}, function(json){
										if (json.status==0){
											disapperTooltip("remind", json.content);
										}else if (json.status==1){
 											disapperTooltip("success",json.content);
											$('.J_umobile').text(json.mobile_hide);
											$('.modal').remove();
											$('.modal_backdrop').remove();
										}else{
											disapperTooltip("remind","修改失败，未知错误");
										}
								});	
							}
						});
						MDialog.setCloseDialog(false);
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});
//发送验证码
		$('.J_send_code').live('click',function() {
					btn=$(this);
					if (btn.hasClass('btn_disabled')) return false;
					function settime(countdown) {
						if (countdown == 0) {
							btn.removeClass('btn_disabled');
							btn.text('获取验证码');
							countdown = <?php echo C('UU_SMS_SETTIME');?>;
							return;
						} else {
							btn.addClass('btn_disabled');
							btn.text('重新发送' + countdown + '秒');
							countdown--;
						}
						setTimeout(function() {
							settime(countdown)
						},1000)
					}
					var mobile=$('input[name=mobile]').val();
					if (mobile.length!=11){
						disapperTooltip("remind",'请填写正确的手机号');
						return false;
					}
					btn.addClass('btn_disabled').html('正在发送中.');
					$.getJSON(ajaxURL, { act:"ajax_send_mobile_code",mobile:mobile,in_user:0}, function(json){
						if (json.status==0){
							btn.removeClass('btn_disabled').html('获取验证码');
							disapperTooltip("remind",json.content);
						}else if (json.status==1){
							disapperTooltip("success",json.content);
							settime(<?php echo C('UU_SMS_SETTIME');?>);
						}else{
							btn.removeClass('btn_disabled').html('获取验证码');
							disapperTooltip("remind",json.content);
						}
					});
		});



	$('.J_user_edit_sp').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		 $.getJSON(ajaxURL, { act: "ajax_edit_sp"}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var MDialog = $(this).dialog({
								title: "修改我的擅长",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
								yes: function() {
									specialty=$('#ajax_edit_sp_input').val()
									$.getJSON(ajaxURL, { act: "ajax_edit_sp",specialty:specialty,edit:'1'}, function(json){
										if (json.status==0){
											disapperTooltip("remind", json.content);
										}else if (json.status==1){
 											disapperTooltip("success",json.content);
											$('.J_user_edit_sp').text(json.specialty);
										}else{
											disapperTooltip("remind","修改失败，未知错误");
										}
								});	
							}
						});
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});
});
</script>
</body>
</html>